From: Claudio Cambra Date: Tue, 14 Jan 2025 05:02:00 +0000 (+0800) Subject: updater: Replace SUUpdater with SPUStandardUpdaterController X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~2^2~135^2~3 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=2cce2636efca77ec36a3577ba493a92ee1a4edd3;p=nextcloud-desktop.git updater: Replace SUUpdater with SPUStandardUpdaterController Signed-off-by: Claudio Cambra --- diff --git a/src/gui/updater/sparkleupdater_mac.mm b/src/gui/updater/sparkleupdater_mac.mm index 062ca31a3..49285c317 100644 --- a/src/gui/updater/sparkleupdater_mac.mm +++ b/src/gui/updater/sparkleupdater_mac.mm @@ -15,7 +15,6 @@ #include #include -#include #include #include "common/utility.h" @@ -34,7 +33,7 @@ public: ~SparkleInterface() { - [updater release]; + [updaterController release]; [delegate release]; } @@ -45,7 +44,7 @@ public: emit q->statusChanged(); } - SUUpdater* updater; + SPUStandardUpdaterController *updaterController; NCSparkleUpdaterDelegate *delegate; private: @@ -250,27 +249,25 @@ SparkleUpdater::SparkleUpdater(const QUrl& appCastUrl) _interface->delegate = [[NCSparkleUpdaterDelegate alloc] initWithOwner:_interface.get()]; [_interface->delegate retain]; - _interface->updater = [SUUpdater sharedUpdater]; - [_interface->updater setDelegate:_interface->delegate]; - [_interface->updater setAutomaticallyChecksForUpdates:YES]; - [_interface->updater setAutomaticallyDownloadsUpdates:NO]; - [_interface->updater setSendsSystemProfile:NO]; - [_interface->updater resetUpdateCycle]; - [_interface->updater retain]; + _interface->updaterController = + [[SPUStandardUpdaterController alloc] initWithStartingUpdater:YES + updaterDelegate:_interface->delegate + userDriverDelegate:nil]; + [_interface->updaterController retain]; setUpdateUrl(appCastUrl); // Sparkle 1.8 required const auto userAgentString = QString::fromUtf8(Utility::userAgentString()); - NSString *userAgent = userAgentString.toNSString(); - [_interface->updater setUserAgentString: userAgent]; + NSString *const userAgent = userAgentString.toNSString(); + _interface->updaterController.updater.userAgentString = userAgent; } SparkleUpdater::~SparkleUpdater() = default; void SparkleUpdater::setUpdateUrl(const QUrl &url) { - [_interface->updater setFeedURL:url.toNSURL()]; + _interface->updaterController.updater.feedURL = url.toNSURL(); } bool SparkleUpdater::autoUpdaterAllowed() @@ -295,7 +292,7 @@ void SparkleUpdater::checkForUpdate() { qCInfo(OCC::lcUpdater) << "Checking for updates."; if (autoUpdaterAllowed()) { - [_interface->updater checkForUpdates: NSApp]; + [_interface->updaterController.updater checkForUpdates]; } } @@ -303,7 +300,7 @@ void SparkleUpdater::backgroundCheckForUpdate() { if (autoUpdaterAllowed() && !ConfigFile().skipUpdateCheck()) { qCInfo(OCC::lcUpdater) << "launching background check"; - [_interface->updater checkForUpdatesInBackground]; + [_interface->updaterController.updater checkForUpdatesInBackground]; } else { qCInfo(OCC::lcUpdater) << "not launching background check, auto updater not allowed or update check skipped in config"; }